# eric7.Preferences.ShortcutsDialog

Module implementing a dialog for the configuration of eric's keyboard shortcuts.

### Global Attributes

None

### Classes

ShortcutsDialog | Class implementing a dialog for the configuration of eric's keyboard shortcuts.

### Functions

None

## ShortcutsDialog

Class implementing a dialog for the configuration of eric's keyboard shortcuts.

### Signals

updateShortcuts()
  emitted when the user pressed the dialogs OK button

### Derived from

QDialog, Ui_ShortcutsDialog

### Class Attributes

noCheckRole
objectNameRole
objectTypeRole

### Class Methods

None

### Methods

ShortcutsDialog | Constructor
__checkShortcut | Private method to check a keysequence for uniqueness.
__generateCategoryItem | Private method to generate a category item.
__generateShortcutItem | Private method to generate a keyboard shortcut item.
__resizeColumns | Private method to resize the list columns.
__resort | Private method to resort the tree.
__saveCategoryActions | Private method to save the actions for a category.
__shortcutChanged | Private slot to handle the shortcutChanged signal of the shortcut dialog.
on_actionButton_toggled | Private slot called, when the action radio button is toggled.
on_buttonBox_accepted | Private slot to handle the OK button press.
on_searchEdit_textChanged | Private slot called, when the text in the search edit changes.
on_shortcutButton_toggled | Private slot called, when the shortcuts radio button is toggled.
on_shortcutsList_itemChanged | Private slot to handle the edit of a shortcut key.
on_shortcutsList_itemClicked | Private slot to handle a click in the shortcuts list.
on_shortcutsList_itemDoubleClicked | Private slot to handle a double click in the shortcuts list.
populate | Public method to populate the dialog.

### Static Methods

None

#### ShortcutsDialog (Constructor)

ShortcutsDialog(parent=None)

Constructor

parent (QWidget)
  parent widget of this dialog

#### ShortcutsDialog.__checkShortcut

__checkShortcut(keysequence, objectType, origTopItem)

Private method to check a keysequence for uniqueness.

keysequence (QKeySequence)
  the keysequence to check
objectType (str)
  type of the object. Entries with the same object type are not checked for uniqueness.
origTopItem (QTreeWidgetItem)
  refrence to the parent of the item to be checked

Return:
  flag indicating uniqueness

Return Type:
  bool

#### ShortcutsDialog.__generateCategoryItem

__generateCategoryItem(title)

Private method to generate a category item.

title (str)
  title for the item

Return:
  reference to the category item

Return Type:
  QTreeWidgetItem

#### ShortcutsDialog.__generateShortcutItem

__generateShortcutItem(category, action, noCheck=False, objectType="")

Private method to generate a keyboard shortcut item.

category (QTreeWidgetItem)
  reference to the category item
action (EricAction)
  reference to the keyboard action
noCheck (bool)
  flag indicating that no uniqueness check should be performed
objectType (str)
  type of the object. Objects of the same type are not checked for duplicate shortcuts.

#### ShortcutsDialog.__resizeColumns

__resizeColumns()

Private method to resize the list columns.

#### ShortcutsDialog.__resort

__resort()

Private method to resort the tree.

#### ShortcutsDialog.__saveCategoryActions

__saveCategoryActions(category, actions)

Private method to save the actions for a category.

category (QTreeWidgetItem)
  reference to the category item
actions (list of EricAction)
  list of actions for the category

#### ShortcutsDialog.__shortcutChanged

__shortcutChanged(keysequence, altKeysequence, noCheck, objectType)

Private slot to handle the shortcutChanged signal of the shortcut dialog.

keysequence (QKeySequence)
  the keysequence of the changed action
altKeysequence (QKeySequence)
  the alternative keysequence of the changed action
noCheck (bool)
  flag indicating that no uniqueness check should be performed
objectType (str)
  type of the object

#### ShortcutsDialog.on_actionButton_toggled

on_actionButton_toggled(checked)

Private slot called, when the action radio button is toggled.

checked (bool)
  state of the action radio button

#### ShortcutsDialog.on_buttonBox_accepted

on_buttonBox_accepted()

Private slot to handle the OK button press.

#### ShortcutsDialog.on_searchEdit_textChanged

on_searchEdit_textChanged(txt)

Private slot called, when the text in the search edit changes.

txt (str)
  text of the search edit

#### ShortcutsDialog.on_shortcutButton_toggled

on_shortcutButton_toggled(checked)

Private slot called, when the shortcuts radio button is toggled.

checked (bool)
  state of the shortcuts radio button

#### ShortcutsDialog.on_shortcutsList_itemChanged

on_shortcutsList_itemChanged(itm, column)

Private slot to handle the edit of a shortcut key.

itm (QTreeWidgetItem)
  reference to the item changed
column (int)
  column changed

#### ShortcutsDialog.on_shortcutsList_itemClicked

on_shortcutsList_itemClicked(itm, column)

Private slot to handle a click in the shortcuts list.

itm (QTreeWidgetItem)
  the list item that was clicked
column (int)
  the list item was clicked in

#### ShortcutsDialog.on_shortcutsList_itemDoubleClicked

on_shortcutsList_itemDoubleClicked(itm, column)

Private slot to handle a double click in the shortcuts list.

itm (QTreeWidgetItem)
  the list item that was double clicked
column (int)
  the list item was double clicked in

#### ShortcutsDialog.populate

populate(webBrowser=None)

Public method to populate the dialog.

webBrowser (WebBrowserWindow)
  reference to the web browser window object

Up